package com.hashmap1;

import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

public class TestMap1 {
public static void main(String[] args) {
	HashMap<Integer,String> map=new HashMap<Integer,String>();
	map.put(1, "deepak");
	map.put(3, "kumar");
	map.put(5, "avi");
	map.put(2, "amit");
	map.put(9, "goswami");
	System.out.println(map);
	Iterator itr=map.keySet().iterator();
	while(itr.hasNext()){
		Object key=itr.next();
		Object val=map.get(key);
		System.out.println(key+"\t"+val);
	}
	
	/*for(Map.Entry<Integer,String> en: map.entrySet()){
		System.out.println(en.getKey()+"\t"+en.getValue());
	}*/
	System.out.println("--------------");
	Iterator it=map.keySet().iterator();
	while(it.hasNext()){
		Object k=it.next();
		Object v=map.get(k);
		System.out.println(k+"\t"+v);
	}
}
}
